home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 009a / tde221.zip / TDEFUNC.H < prev    next >
Text File  |  1993-04-01  |  16KB  |  412 lines

  1. /*
  2.  * New editor name:  TDE, the Thomson-Davis Editor.
  3.  * Author:           Frank Davis
  4.  * Date:             June 5, 1991
  5.  *
  6.  * This modification of Douglas Thomson's code is released into the
  7.  * public domain, Frank Davis.  You may distribute it freely.
  8.  *
  9.  * This file contains all prototypes for every function in tde.  It should
  10.  * be included in every source code module.
  11.  *
  12.  * I'm so stupid, I can't keep up with which functions are used in which
  13.  * files.  Let's gather all prototypes into one file, so I don't have
  14.  * to remember too much.
  15.  */
  16.  
  17.  
  18. /*************************  function prototypes in block.c *************/
  19. int  mark_block( WINDOW * );
  20. int  unmark_block( WINDOW * );
  21. void restore_marked_block( WINDOW *, int );
  22. int  prepare_block( WINDOW *, line_list_ptr, int );
  23. int  pad_dest_line( WINDOW *, file_infos *, line_list_ptr );
  24. int  move_copy_delete_overlay_block( WINDOW * );
  25. void do_line_block( WINDOW *,  WINDOW *,  int,  file_infos *,  file_infos *,
  26.                     line_list_ptr,  line_list_ptr,  line_list_ptr,
  27.                     line_list_ptr,  long,  long,  int * );
  28. void do_stream_block( WINDOW *,  WINDOW *,  int,  file_infos *,
  29.                       file_infos *,  line_list_ptr,  line_list_ptr,
  30.                       line_list_ptr,  line_list_ptr,
  31.                       long,  long,  long,  int,  int,  int,  int * );
  32. void do_box_block( WINDOW *,  WINDOW *,  int,  file_infos *,  file_infos *,
  33.                    line_list_ptr, line_list_ptr,  long,  long, long,
  34.                    long,  long,  int,  int, int,
  35.                    int,  int,  int,  int,  int * );
  36. void load_box_buff( char *, line_list_ptr, int, int, char );
  37. int  copy_buff_2file( WINDOW *, char *, line_list_ptr, int, int, int );
  38. void block_fill( char *, int, int );
  39. void number_block_buff( char *, int, long, int );
  40. void restore_cursors( file_infos * );
  41. int  delete_box_block( WINDOW *, line_list_ptr, int, int );
  42. void check_block( void );
  43. void find_begblock( file_infos * );
  44. void find_endblock( file_infos * );
  45. int  block_write( WINDOW * );
  46. int  block_print( WINDOW * );
  47. int  get_block_fill_char( WINDOW *, int * );
  48. int  get_block_numbers( WINDOW *, long *, long *, int * );
  49. int  block_trim_trailing( WINDOW * );
  50. int  block_email_reply( WINDOW * );
  51. int  block_convert_case( WINDOW * );
  52. void upper_case( text_ptr, size_t );
  53. void lower_case( text_ptr, size_t );
  54. void rot13( text_ptr, size_t );
  55. void fix_uue( text_ptr, size_t );
  56. void strip_hi( text_ptr, size_t );
  57. /************************************************************************/
  58.  
  59.  
  60. /**********************  function prototypes in console.c  **************/
  61. void video_config( struct vcfg *cfg );
  62. int  getkey( void );
  63. int  waitkey( int );
  64. int  getfunc( int );
  65. int  two_key( WINDOW * );
  66. void xygoto( int, int );
  67. void update_line( WINDOW * );
  68. void c_output( int, int, int, int );
  69. void s_output( char far *, int, int, int );
  70. void eol_clear( int, int, int );
  71. void window_eol_clear( WINDOW *, int );
  72. void hlight_line( int, int, int, int );
  73. void cls( void );
  74. void set_cursor_size( int );
  75. void set_overscan_color( int );
  76. void save_screen_line( int, int, char * );
  77. void restore_screen_line( int, int, char * );
  78. /************************************************************************/
  79.  
  80.  
  81. /*************************  function prototypes in diff.c  **************/
  82. int  define_diff( WINDOW * );
  83. int  repeat_diff( WINDOW * );
  84. int  differ( int, int, int );
  85. int  skip_leading_space( text_ptr, int );
  86. line_list_ptr skip_eol( line_list_ptr, int *, int *, long *, long * );
  87. void show_diff_window( WINDOW * );
  88. int  verify_number( char *, int * );
  89. int  verify_letter( char *, int *, WINDOW ** );
  90. /************************************************************************/
  91.  
  92.  
  93. /*************************  function prototypes in dirlist.c *************/
  94. int  dir_help( WINDOW * );
  95. void far *my_calloc( unsigned, unsigned );
  96. int  validate_path( char *, char * );
  97. int  list_and_pick( char *, char *, WINDOW * );
  98. void setup_directory_window( DIRECTORY *, int );
  99. void recalculate_dir( DIRECTORY *, FTYPE *, int );
  100. void write_directory_list( FTYPE *, DIRECTORY );
  101. int  select_file( FTYPE *, char *, DIRECTORY * );
  102. void shell_sort( FTYPE *, int );
  103. /************************************************************************/
  104.  
  105.  
  106. /*************************  function prototypes in ed.c *****************/
  107. int  insert_newline( WINDOW * );
  108. int  insert_overwrite( WINDOW * );
  109. int  join_line( WINDOW * );
  110. int  dup_line( WINDOW * );
  111. int  word_delete( WINDOW * );
  112. int  back_space( WINDOW * );
  113. int  line_kill( WINDOW * );
  114. int  char_del_under( WINDOW * );
  115. int  eol_kill( WINDOW * );
  116. int  undo_line( WINDOW * );
  117. int  undo( WINDOW * );
  118. int  beg_next_line( WINDOW *window );
  119. int  next_line( WINDOW *window );
  120. int  home( WINDOW * );
  121. int  goto_eol( WINDOW * );
  122. int  goto_top( WINDOW * );
  123. int  goto_bottom( WINDOW * );
  124. int  set_tabstop( WINDOW * );
  125. void show_line_col( WINDOW * );
  126. void show_asterisk( WINDOW * );
  127. int  toggle_overwrite( WINDOW * );
  128. int  toggle_smart_tabs( WINDOW * );
  129. int  toggle_indent( WINDOW * );
  130. int  set_left_margin( WINDOW * );
  131. int  set_right_margin( WINDOW * );
  132. int  set_paragraph_margin( WINDOW * );
  133. int  toggle_ww( WINDOW * );
  134. int  toggle_crlf( WINDOW * );
  135. int  toggle_trailing( WINDOW * );
  136. int  toggle_z( WINDOW * );
  137. int  toggle_eol( WINDOW * );
  138. int  toggle_search_case( WINDOW * );
  139. int  toggle_sync( WINDOW * );
  140. int  toggle_ruler( WINDOW * );
  141. int  toggle_tabinflate( WINDOW * );
  142. void sync( WINDOW * );
  143. void editor( void );
  144. void display_dirty_windows( WINDOW * );
  145. void show_dirty_window( WINDOW * );
  146. /************************************************************************/
  147.  
  148.  
  149. /*************************  function prototypes in file.c  **************/
  150. int  hw_fattrib( char * );
  151. int  change_mode( char *, int );
  152. int  write_file( char *, int, file_infos *, long, long, int );
  153. int  hw_save( char *, file_infos *, long, long, int );
  154. int  hw_append( char *, file_infos *, long, long, int );
  155. int  load_file( char *, file_infos *, int *, int );
  156. void insert_node( file_infos *, line_list_ptr, line_list_ptr );
  157. int  show_file_2big( char *, int, line_list_ptr, text_ptr );
  158. int  backup_file( WINDOW * );
  159. int  edit_file( char *, int, int );
  160. int  edit_another_file( WINDOW * );
  161. int  edit_next_file( WINDOW * );
  162. int  search_and_seize( WINDOW * );
  163. int  attempt_edit_display( char *, int, int, int );
  164. void make_backup_fname( file_infos * );
  165. int  file_file( WINDOW * );
  166. int  save_file( WINDOW * );
  167. int  save_backup( WINDOW * );
  168. int  write_to_disk( WINDOW *, char * );
  169. int  save_as_file( WINDOW * );
  170. int  change_fattr( WINDOW * );
  171. int  get_fattr( char far *, int * );
  172. int  set_fattr( char far *, int );
  173. int  get_current_directory( char far *, int );
  174. int  set_current_directory( char far * );
  175. /************************************************************************/
  176.  
  177.  
  178. /*************************  function prototypes in findrep.c ************/
  179. int  get_replacement_flags( int );
  180. int  ask_replace( WINDOW *, int * );
  181. int  ask_wrap_replace( WINDOW *, int * );
  182. void do_replace( WINDOW *, int );
  183. int  find_string( WINDOW * );
  184. void build_boyer_array( void );
  185. void build_forward_skip( boyer_moore_type * );
  186. void build_backward_skip( boyer_moore_type * );
  187. int  calculate_forward_md2( char *, int );
  188. int  calculate_backward_md2( char *, int );
  189. line_list_ptr forward_boyer_moore_search( WINDOW *, long *, int * );
  190. line_list_ptr search_forward( line_list_ptr, long *, unsigned * );
  191. line_list_ptr backward_boyer_moore_search( WINDOW *, long *, int * );
  192. line_list_ptr search_backward( line_list_ptr, long *, unsigned * );
  193. void show_search_message( int, int );
  194. void bin_offset_adjust( WINDOW *, long );
  195. void find_adjust( WINDOW *, line_list_ptr, long, int );
  196. int  replace_string( WINDOW * );
  197. int  replace_and_display( WINDOW *, line_list_ptr, long, int, int *, int *, int );
  198. line_list_ptr scan_forward( long *, int *, line_list_ptr, char, char, int * );
  199. line_list_ptr scan_backward( long *, int *, line_list_ptr, char, char, int * );
  200. int  match_pair( WINDOW * );
  201. /************************************************************************/
  202.  
  203.  
  204. /*************************  function prototypes in hwind.c **************/
  205. void get_date( int *, int *, int *, int * );
  206. void get_time( int *, int *, int *, int * );
  207. void show_end_mem( void );
  208. void show_end_text( WINDOW * );
  209. void show_modes( void );
  210. void show_file_count( int );
  211. void show_window_count( int );
  212. void show_avail_mem( void );
  213. void show_tab_modes( void );
  214. void show_indent_mode( void );
  215. void show_search_case( void );
  216. void show_sync_mode( void );
  217. void show_wordwrap_mode( void );
  218. void show_trailing( void );
  219. void show_control_z( void );
  220. void show_insert_mode( void );
  221. void my_scroll_down( WINDOW * );
  222. void combine_strings( char *, char *, char *, char * );
  223. void make_ruler( WINDOW * );
  224. void show_ruler( WINDOW * );
  225. void show_ruler_char( WINDOW * );
  226. void show_ruler_pointer( WINDOW * );
  227. void show_all_rulers( void );
  228. /************************************************************************/
  229.  
  230.  
  231. /************************  function prototypes in macro.c  **************/
  232. int  record_on_off( WINDOW * );
  233. void record_keys( int );
  234. void show_avail_strokes( void );
  235. int  save_strokes( WINDOW * );
  236. int  load_strokes( WINDOW * );
  237. int  clear_macros( WINDOW * );
  238. void connect_macros( void );
  239. int  play_back( WINDOW * );
  240. int  push_macro_stack( int );
  241. int  pop_macro_stack( int * );
  242. int  pause( WINDOW * );
  243. /************************************************************************/
  244.  
  245.  
  246. /*************************  function prototypes in main.c  **************/
  247. void main( int, char *[] );
  248. void error( int, int, char * );
  249. #if defined( __MSC__ )
  250. void interrupt far harmless( void );
  251. void interrupt far ctrl_break( void );
  252. #else
  253. static int harmless( void );
  254. #endif
  255. void terminate( void );
  256. void initialize( void );
  257. void hw_initialize( void );
  258. int  get_help( WINDOW * );
  259. void show_credits( void );
  260. /************************************************************************/
  261.  
  262.  
  263. /*************************  function prototypes in port.c *************/
  264. void far * my_malloc( size_t, int * );
  265. void my_free( void far * );
  266. int  my_findfirst( DTA far *, char far *, int );
  267. int  my_findnext( DTA far * );
  268. /************************************************************************/
  269.  
  270.  
  271. /*************************  function prototypes in sort.c *************/
  272. int  sort_box_block( WINDOW *window );
  273. void quick_sort_block( long, long, line_list_ptr, line_list_ptr );
  274. void insertion_sort_block( long, long, line_list_ptr );
  275. void load_pivot( line_list_ptr );
  276. int  compare_pivot( line_list_ptr );
  277. int  my_memcmp( text_ptr, text_ptr, int );
  278. /************************************************************************/
  279.  
  280.  
  281. /**********************  function prototypes in tab.c  ******************/
  282. int  tab_key( WINDOW * );
  283. int  backtab( WINDOW * );
  284. int  next_smart_tab( WINDOW * );
  285. int  prev_smart_tab( WINDOW * );
  286. text_ptr entab( text_ptr, int );
  287. void detab_linebuff( void );
  288. void entab_linebuff( void );
  289. text_ptr detab_a_line( text_ptr, int * );
  290. int  detab_adjust_rcol( text_ptr, int );
  291. int  entab_adjust_rcol( text_ptr, int, int );
  292. int  block_expand_tabs( WINDOW * );
  293. int  block_compress_tabs( WINDOW * );
  294. /************************************************************************/
  295.  
  296.  
  297. /*************************  function prototypes in utils.c **************/
  298. int  myiswhitespc( int );
  299. void check_virtual_col( WINDOW *, int, int );
  300. void copy_line( line_list_ptr );
  301. int  un_copy_line( line_list_ptr,  WINDOW * , int );
  302. int  un_copy_tab_buffer( line_list_ptr, WINDOW * );
  303. void load_undo_buffer( file_infos *, text_ptr, int );
  304. void set_prompt( char *, int );
  305. int  get_name( char *, int, char *, int );
  306. int  get_sort_order( WINDOW * );
  307. int  get_replace_direction( WINDOW * );
  308. int  get_yn( void );
  309. int  get_lr( void );
  310. int  get_bc( void );
  311. int  get_oa( void );
  312. void show_eof( WINDOW * );
  313. void display_current_window( WINDOW * );
  314. int  redraw_screen( WINDOW * );
  315. void redraw_current_window( WINDOW * );
  316. void show_changed_line( WINDOW * );
  317. void show_curl_line( WINDOW * );
  318. void dup_window_info( WINDOW *, WINDOW * );
  319. void adjust_windows_cursor( WINDOW *, long );
  320. int  first_non_blank( text_ptr, int );
  321. int  find_end( text_ptr, int );
  322. int  is_line_blank( text_ptr, int );
  323. int  page_up( WINDOW * );
  324. int  page_down( WINDOW * );
  325. int  scroll_down( WINDOW * );
  326. int  scroll_up( WINDOW * );
  327. int  pan_up( WINDOW * );
  328. int  pan_down( WINDOW * );
  329. void show_window_header( WINDOW * );
  330. void show_window_number_letter( WINDOW * );
  331. void show_window_fname( WINDOW * );
  332. void show_crlf_mode( WINDOW * );
  333. void show_size( WINDOW * );
  334. int  quit( WINDOW * );
  335. int  move_up( WINDOW * );
  336. int  move_down( WINDOW * );
  337. int  prepare_move_down( WINDOW * );
  338. int  move_left( WINDOW * );
  339. int  move_right( WINDOW * );
  340. int  pan_left( WINDOW * );
  341. int  pan_right( WINDOW * );
  342. int  word_left( WINDOW * );
  343. int  word_right( WINDOW * );
  344. int  next_dirty_line( WINDOW * );
  345. int  prev_dirty_line( WINDOW * );
  346. int  center_window( WINDOW * );
  347. int  horizontal_screen_right( WINDOW * );
  348. int  horizontal_screen_left( WINDOW * );
  349. int  goto_top_file( WINDOW * );
  350. int  goto_end_file( WINDOW * );
  351. int  goto_line( WINDOW * );
  352. int  set_marker( WINDOW * );
  353. int  goto_marker( WINDOW * );
  354. int  date_time_stamp( WINDOW * );
  355. int  add_chars( char *, WINDOW * );
  356. /************************************************************************/
  357.  
  358.  
  359. /*************************  function prototypes in window.c *************/
  360. int  initialize_window( void );
  361. void choose_window( char *, WINDOW * );
  362. int  next_window( WINDOW * );
  363. int  prev_window( WINDOW * );
  364. int  split_horizontal( WINDOW * );
  365. int  split_vertical( WINDOW * );
  366. void show_vertical_separator( WINDOW * );
  367. int  size_window( WINDOW * );
  368. int  zoom_window( WINDOW * );
  369. int  next_hidden_window( WINDOW * );
  370. void setup_window( WINDOW * );
  371. void finish( WINDOW * );
  372. int  create_window( WINDOW **, int, int, int, int, file_infos * );
  373. /************************************************************************/
  374.  
  375.  
  376. /**********************  function prototypes in wordwrap.c **************/
  377. int  find_left_margin( line_list_ptr, int );
  378. void word_wrap( WINDOW * );
  379. int  format_paragraph( WINDOW *window );
  380. void combine_wrap_spill( WINDOW *, int, int, int, int, int );
  381. void justify_right_margin( WINDOW *, line_list_ptr, int, int, int );
  382. void remove_spaces( int );
  383. int  find_word( text_ptr, int, int );
  384. int  flush_left( WINDOW * );
  385. int  flush_right( WINDOW * );
  386. int  flush_center( WINDOW * );
  387. /************************************************************************/
  388.  
  389.  
  390. /*************************  function prototypes in tdeasm.c *************/
  391. unsigned long  ptoul( void far * );
  392. text_ptr tabout( text_ptr, int * );
  393. /*****************************************************/
  394.  
  395.  
  396. /***********  function prototype for simul101.asm *************/
  397. void far simulate_enh_kbd( int );
  398. /*****************************************************/
  399.  
  400.  
  401. /***********  function prototype for criterr.asm *************/
  402. void far install_ceh( void far * );
  403. /*****************************************************/
  404.  
  405.  
  406. /***********  function prototype for criterr.c   *************/
  407. int  far crit_err_handler( void );
  408. void show_error_screen( int, int );
  409. void save_area( char far * );
  410. void restore_area( char far * );
  411. /*****************************************************/
  412.